<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件修饰符</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="root">
    <h2>来{{name}}学习啦</h2>
    <!--1. .prevent阻止默认行为-->
    <a href="https://www.baidu.com/" @click.prevent="showInfor">点击跳转</a>
</div>
<script>
    Vue.config.productionTip = false;
    new Vue({
        el: '#root',
        data: {
            name: '西北工业大学'
        },
        methods: {
            showInfor(event) {
                // 阻止默认行为：跳转
                // event.preventDefault();
                // event.stopPropagation()
                alert("哈喽啊");
            }
        }
    });
</script>
</body>
</html>